!!M Inlines.f
!!S makearray
	subroutine makearray (arraysize, myarray)
	implicit none

	integer*4 arraysize
	include 'wendigo:mpw:fincludes:memtypes.f'
	
	structure /array/
		integer*4 f(1)
	end structure
	
	structure /Parray/
		pointer /array/ P
	end structure
	
	structure /Harray/
		pointer /Parray/ H
	end structure

	record /Harray/ myarray

	integer i,j
c
c	sets up new array of length arraysize
c	and initializes it.
c	returns -1 in arraysize when the handle couldn't be created.
c
	j = newHandle(%val(arraysize*4))
	if (j.ne.0) then
		myarray.h = j
	
		do i=1,arraysize
			myarray.h^.p^.f(i) = i
		end do
	
	else
		arraysize = -1
	end if
	
	return
	end
